/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package questao02;

import java.io.IOException;
import java.util.logging.Level;

/**
 *
 * @author SDKW
 */
public class LoggerEventViewer implements Logger {

    @Override
    public void log(String log) {
        // Rodar a aplicação como administrador.
        String command = "EVENTCREATE /T INFORMATION /ID 1000 /L APPLICATION /D \"LOG:: " + log + "\"";

        try {
            Runtime.getRuntime().exec(command);
        } catch (IOException ex) {
            java.util.logging.Logger.getLogger(Aplicacao.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void close() {
        
    }
}
